package com.test.common;

import java.io.Serializable;



import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;




@ManagedBean(name = "adaugaIntrebareBean")
@SessionScoped
public class AdaugaIntrebareBean implements Serializable {
	private static final long serialVersionUID = -4759076671753497857L;
	private long id;
	private long chestionar_id;
	private String text;
	private int tip;
	
	public long getId(){
		return id;
	}
	
	public long getChestionar_id(){
		return chestionar_id;
	}
	 
	public String getText(){
		return text;
	}
	
	public int getTip(){
		return tip;
	}
	
	public void setId(long id){
		this.id=id;	
	}
	
	public void setChestionar_id(long id){
		this.chestionar_id=id;
	}
	
	public void setText(String text){
		this.text=text;
	}
	
	public void setTip(int tip){
		this.tip=tip;
	}
	
	public String add_optiune(){
	/*	if (this.id==0){
			FacesMessage msg = new FacesMessage("Incercare esuata",
			"Introduceti id intrebare");
			msg.setSeverity(FacesMessage.SEVERITY_ERROR);
			FacesContext.getCurrentInstance().addMessage(null, msg);
			return null;
		}
		if (this.text==null){
			FacesMessage msg = new FacesMessage("Incercare esuata",
			"Introduceti intrebarea");
			msg.setSeverity(FacesMessage.SEVERITY_ERROR);
			FacesContext.getCurrentInstance().addMessage(null, msg);
			return null;
		}*/
		return "adauga_optiune";
	}
	
	public String save(){
	/*	if (this.id==0){
			FacesMessage msg = new FacesMessage("Incercare esuata",
			"Introduceti id intrebare");
			msg.setSeverity(FacesMessage.SEVERITY_ERROR);
			FacesContext.getCurrentInstance().addMessage(null, msg);
			return null;
		}
		if (this.text==null){
			FacesMessage msg = new FacesMessage("Incercare esuata",
			"Introduceti intrebarea");
			msg.setSeverity(FacesMessage.SEVERITY_ERROR);
			FacesContext.getCurrentInstance().addMessage(null, msg);
			return null;
		}*/
		return "adauga";
	}
}
	